﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;

namespace Digitalmes.Model.WmsManagement
{
    /// <summary>
    /// 仓库模型
    /// </summary>
	[Table("Warehouse")]

    [Display(Name = "_Model.Warehouse")]
    public class Warehouse : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._Warehouse._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._Warehouse._WarehouseCode")]
        [Comment("仓库编号")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string WarehouseCode { get; set; }
        [Display(Name = "_Model._Warehouse._Name")]
        [Comment("仓库名称")]
        public string Name { get; set; }
        [Display(Name = "_Model._Warehouse._Address")]
        [Comment("地址")]
        public string Address { get; set; }
        [Display(Name = "_Model._Warehouse._Manager")]
        [Comment("负责人")]
        [NotMapped]
        public FrameworkUser Manager { get; set; }
        [Display(Name = "_Model._Warehouse._Manager")]
        [Comment("负责人")]
        public string ManagerId { get; set; }
        [Display(Name = "_Model._Warehouse._Capacity")]
        [Comment("仓储容量")]
        public string Capacity { get; set; }
        [Display(Name = "_Model._Warehouse._IsActive")]
        [Comment("启用")]
        public bool? IsActive { get; set; }
        [Display(Name = "_Model._Warehouse._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }


        public List<MaterialDoc> MaterialDoc { get; set; }  

	}

}
